package com.happywynne.elasticsearchtravel.enums;

import java.util.Random;

/**
 * @author Wynne.Lu
 * @date 2021/1/14 下午10:01
 * @desc
 */
public enum BinType {

    PILLOW(10, "针头"),
    BAG(20, "包装袋");

    private int value;
    private String code;

    BinType(int value, String code) {
        this.value = value;
        this.code = code;
    }

    public static BinType getRandomEnum() {
        Random random = new Random();
        if (random.nextInt(100) % 2 == 0) {
            return PILLOW;
        } else {
            return BAG;
        }
    }

}
